package com.dhl.iterator;

import com.dhl.iterator.college.ComputerCollege;
import com.dhl.iterator.college.InfoCollege;

import java.util.ArrayList;
import java.util.List;

/**
 * @title: Client
 * @Author danghailiang
 * @Date: 2022/8/20 16:13
 * @Version 1.0
 */
// 调用端
public class Client {

    public static void main(String[] args) {
        // 学院集合
        List<College> colleges = new ArrayList<>();

        // 创建学院
        College infoCollege = new InfoCollege();
        College computerCollege = new ComputerCollege();
        // 添加专业
        infoCollege.addDepartment("数据库专业", "数据库专业");
        // 添加专业
        computerCollege.addDepartment("电脑安全专业", "电脑安全专业");

        // 添加到学院里面
        colleges.add(infoCollege);
        colleges.add(computerCollege);


        // 遍历学院和专业
        OutputImpl output = new OutputImpl(colleges);
        output.printCollege();
    }
}
